import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysToolDictAttr = (params) => {
  params.head.transCode = 'querySysToolDictAttr';
  return request({
    url: '/tool/sysToolDictAttr/querySysToolDictAttr',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysToolDictAttrListPage = (params) => {
  params.head.transCode = 'querySysToolDictAttrListPage';
  return request({
    url: '/tool/sysToolDictAttr/querySysToolDictAttrListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysToolDictAttr = (params) => {
  params.head.transCode = 'saveSysToolDictAttr';
  return request({
    url: '/tool/sysToolDictAttr/saveSysToolDictAttr',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysToolDictAttrList = (params) => {
  params.head.transCode = 'saveSysToolDictAttrList';
  return request({
    url: '/tool/sysToolDictAttr/saveSysToolDictAttrList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysToolDictAttr = (params) => {
  params.head.transCode = 'saveOrUpdateSysToolDictAttr';
  return request({
    url: '/tool/sysToolDictAttr/saveOrUpdateSysToolDictAttr',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysToolDictAttrList = (params) => {
  params.head.transCode = 'saveOrUpdateSysToolDictAttrList';
  return request({
    url: '/tool/sysToolDictAttr/saveOrUpdateSysToolDictAttrList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysToolDictAttr = (params) => {
  params.head.transCode = 'updateSysToolDictAttr';
  return request({
    url: '/tool/sysToolDictAttr/updateSysToolDictAttr',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysToolDictAttr = (params) => {
  params.head.transCode = 'deleteSysToolDictAttr';
  return request({
    url: '/tool/sysToolDictAttr/deleteSysToolDictAttr',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysToolDictAttrList = (params) => { 
  params.head.transCode = 'deleteSysToolDictAttrList';
  return request({
    url: '/tool/sysToolDictAttr/deleteSysToolDictAttrList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysToolDictAttrExcel = (params) => {
  downloadExcel({
    url: '/tool/sysToolDictAttr/excelDownload/exportSysToolDictAttrExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
